using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebControls;
using EntityLayer;
using InfraStructureLayer;
using BusinessLayer;

public partial class News_NewsDetail : SFPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

        //LanguageLoad();
    }
    public override void LanguageLoad()
    {
        if (this.QueryStringId.ToString() == "")
        {
            if (Request.QueryString["Id"] != null && Request.QueryString["Id"] != "")
            {
                this.QueryStringId = Request.QueryString["Id"];
            }
        }
        if (this.QueryStringId != "")
        {
                this.Master.FindControl("ContentPlaceHolderMain").Visible = true;
                lblNewsTitle.Text = "";
                lblNewsSummary.Text = "";
                lblNewsBody.Text = "";
                entNewsContents insEntNewsContents = new entNewsContents();
                insEntNewsContents.NewsId = Convert.ToInt32(new Crypto().DecryptURL(this.QueryStringId));
                busNewsContents insBusNewsContents = new busNewsContents();
                insBusNewsContents.SelectNewsContentsByNewsIdAndLanguageId(insEntNewsContents);
                if (insBusNewsContents.HasErrors)
                {

                    MessageBoxShow(insBusNewsContents);
                    this.Master.FindControl("ContentPlaceHolderMain").Visible = false;
                    return;
                }
                entNews insEntNews = new entNews();
                insEntNews.NewsId = insEntNewsContents.NewsId;
                busNews insBusNews = new busNews();
                insBusNews.SelectNewsByNewsId(insEntNews);
                if (insBusNews.HasErrors)
                {
                    MessageBoxShow(insBusNews);
                    return;
                }
                lblNewsTitle.Text = insEntNews.InsertDate.ToShortDateString() + " - " + insEntNewsContents.NewsTitle;
                lblNewsSummary.Text = insEntNewsContents.NewsSummary;
                lblNewsBody.Text = insEntNewsContents.NewsBody;
            }
        base.LanguageLoad();
    }
}
